/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the
 * License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
/**
 * Nudr_DataRepository API OpenAPI file
 * Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB,
 * ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 2.1.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */

#include "PfdChangeNotification.h"

namespace oai::udr::model {

PfdChangeNotification::PfdChangeNotification() {
  m_ApplicationId = "";
  m_RemovalFlag = false;
  m_RemovalFlagIsSet = false;
  m_PartialFlag = false;
  m_PartialFlagIsSet = false;
  m_PfdsIsSet = false;
}

PfdChangeNotification::~PfdChangeNotification() {}

void PfdChangeNotification::validate() {
  // TODO: implement validation
}

void to_json(nlohmann::json &j, const PfdChangeNotification &o) {
  j = nlohmann::json();
  j["applicationId"] = o.m_ApplicationId;
  if (o.removalFlagIsSet())
    j["removalFlag"] = o.m_RemovalFlag;
  if (o.partialFlagIsSet())
    j["partialFlag"] = o.m_PartialFlag;
  if (o.pfdsIsSet() || !o.m_Pfds.empty())
    j["pfds"] = o.m_Pfds;
}

void from_json(const nlohmann::json &j, PfdChangeNotification &o) {
  j.at("applicationId").get_to(o.m_ApplicationId);
  if (j.find("removalFlag") != j.end()) {
    j.at("removalFlag").get_to(o.m_RemovalFlag);
    o.m_RemovalFlagIsSet = true;
  }
  if (j.find("partialFlag") != j.end()) {
    j.at("partialFlag").get_to(o.m_PartialFlag);
    o.m_PartialFlagIsSet = true;
  }
  if (j.find("pfds") != j.end()) {
    j.at("pfds").get_to(o.m_Pfds);
    o.m_PfdsIsSet = true;
  }
}

std::string PfdChangeNotification::getApplicationId() const {
  return m_ApplicationId;
}
void PfdChangeNotification::setApplicationId(std::string const &value) {
  m_ApplicationId = value;
}
bool PfdChangeNotification::isRemovalFlag() const { return m_RemovalFlag; }
void PfdChangeNotification::setRemovalFlag(bool const value) {
  m_RemovalFlag = value;
  m_RemovalFlagIsSet = true;
}
bool PfdChangeNotification::removalFlagIsSet() const {
  return m_RemovalFlagIsSet;
}
void PfdChangeNotification::unsetRemovalFlag() { m_RemovalFlagIsSet = false; }
bool PfdChangeNotification::isPartialFlag() const { return m_PartialFlag; }
void PfdChangeNotification::setPartialFlag(bool const value) {
  m_PartialFlag = value;
  m_PartialFlagIsSet = true;
}
bool PfdChangeNotification::partialFlagIsSet() const {
  return m_PartialFlagIsSet;
}
void PfdChangeNotification::unsetPartialFlag() { m_PartialFlagIsSet = false; }
std::vector<PfdContent> &PfdChangeNotification::getPfds() { return m_Pfds; }
void PfdChangeNotification::setPfds(std::vector<PfdContent> const &value) {
  m_Pfds = value;
  m_PfdsIsSet = true;
}
bool PfdChangeNotification::pfdsIsSet() const { return m_PfdsIsSet; }
void PfdChangeNotification::unsetPfds() { m_PfdsIsSet = false; }

} // namespace oai::udr::model
